<?php
$this->pageTitle='Регистрация';
$this->breadcrumbs=array(
	'Регистрация',
);
?>
<h1>Регистрация</h1>
<?php if(Yii::app()->user->hasFlash('registration_error')): ?>
	<div class="errorMessage">
		<?php echo Yii::app()->user->getFlash('registration_error'); ?>
	</div>
<?php else: ?>
	<?php if(Yii::app()->user->hasFlash('registration')): ?>
	
		<div class="flash-success">
			<?php echo Yii::app()->user->getFlash('registration'); ?>
		</div>
	
	<?php else: ?>
		<?php $form=$this->beginWidget('CActiveForm', array(
			'id'=>'login-form',
			'enableAjaxValidation'=>false,
		)); ?>
		<div class="u_cat also">
			<table class="flds_form">
				<tbody>
					<tr>
						<td class="flds_form_l">
							<?php echo $form->labelEx($model,'first_name'); ?>
						</td>
						<td class="flds_form_r">
							<div class="flds_border">
								<div class="flds_border_inside">
									<?php echo $form->textField($model,'first_name', array('class'=>'settings_fld')); ?>
								</div>
								<?php echo $form->error($model,'first_name'); ?>
							</div>
						</td>
					</tr>
					<tr>
						<td class="flds_form_l">
							<?php echo $form->labelEx($model,'last_name'); ?>
						</td>
						<td class="flds_form_r">
							<div class="flds_border">
								<div class="flds_border_inside">
									<?php echo $form->textField($model,'last_name', array('class'=>'settings_fld')); ?>
								</div>
								<?php echo $form->error($model,'last_name'); ?>
							</div>
						</td>
					</tr>
					<tr>
						<td class="flds_form_l">
							<?php echo $form->labelEx($model,'sex'); ?>
						</td>
						<td class="flds_form_r">
							<div class="flds_border">
								<div class="select_block long">		
									<?php echo $form->dropDownList($model, 'sex', array('M'=>'Мужской', 'W'=>'Женский'), array('empty'=>'Выберите пол'));?>
								</div>
								<?php echo $form->error($model,'sex'); ?>
							</div>
						</td>
					</tr>
					<tr>
						<td class="flds_form_l">
							<?php echo $form->labelEx($model,'email'); ?>
						</td>
						<td class="flds_form_r">
							<div class="flds_border">
								<div class="flds_border_inside">
									<?php echo $form->textField($model,'email', array('class'=>'settings_fld')); ?>
								</div>
								<?php echo $form->error($model,'email'); ?>
							</div>
						</td>
					</tr>
					<tr>
						<td class="flds_form_l">
							<?php echo $form->labelEx($model,'password'); ?>
						</td>
						<td class="flds_form_r">
							<div class="flds_border">
								<div class="flds_border_inside">
									<?php echo $form->passwordField($model,'password', array('class'=>'settings_fld')); ?>
								</div>
								<?php echo $form->error($model,'password'); ?>
							</div>
						</td>
					</tr>
					<tr>
						<td class="flds_form_l">
							<?php echo $form->labelEx($model,'password_twice'); ?>
						</td>
						<td class="flds_form_r">
							<div class="flds_border">
								<div class="flds_border_inside">
									<?php echo $form->passwordField($model,'password_twice', array('class'=>'settings_fld')); ?>
								</div>
								<?php echo $form->error($model,'password_twice'); ?>
							</div>
						</td>
					</tr>
				</tbody>
			</table>
		<div class="checkbox_row fll">
			<div class="checkbox_block checked">
				<div></div>
				<?php echo $form->checkBox($model,'agree',  array('checked'=>'checked')); ?>
				<?php echo $form->label($model,'agree'); ?>
				<?php echo $form->error($model,'agree'); ?>
			</div>
		</div>
		</div>
		<div class="row submit">
			<?php echo CHtml::submitButton('Зарегестрироватся', array('class'=>'green_btn tac')); ?>
		</div>
		<?php $this->endWidget(); ?>
	<?php endif; ?>
<?php endif; ?>